from ..dialogs import UserMessage
from settings import UserSettings
import wx

class HistoryHandler:
    _shared_state = {}
    
    def __init__(self):
        self.__dict__ = self._shared_state
        self.userSettings = UserSettings.UserSettings()
    
    def setState(self):
        if not hasattr(self, "fileHistory"):
            self.fileHistory = wx.FileHistory()
            [self.fileHistory.AddFileToHistory(file) for file in
                                 self.userSettings.fileHistoryList()]
        return self
    
    def updateMenu(self):
        pass
    
    def AddFileToHistory(self, file):
        self.fileHistory
#                    self.userSettings.updateHistory(file)